package com.array.demo;
import java.util.Arrays;

public class ArrayApi {
public static void main(String[] args) {
	System.out.println("=======test array api=========");
	//create array
	int[] array= new int[2];
	array[0] = 3;
	array[1] = 44;
	int[] arrayB = new int[2];
	arrayB[0]  =3;
	arrayB[1] = 44;
	//ouput length
	System.out.print("==========length======");
	System.out.println(array.length);
	//compare equals
	System.out.print("==========compare=====");
	System.out.println(Arrays.equals(arrayB,array));
	//to string
	System.out.println("---------array-----string");
	System.out.println(Arrays.toString(array));
	//copy array
	int[] arrayC = Arrays.copyOf(arrayB,1);
	System.out.println(Arrays.toString(arrayC));
	
}
}
